import React from 'react'

import defaultImg from '../../pages/assets/images/接收.jpg'

import receiveImg from '../../pages/assets/images/接收2.jpg'

//导入connect
import {connect} from 'react-redux'

class Girl extends React.Component {
    render() {
        console.log('Girl-props', this.props) //{name: "marry", age: 18, status: false, dispatch: ƒ}

        return (
            <div>
                <img src={this.props.status ? receiveImg : defaultImg}/>
            </div>
        )
    }
}

//接收两个参数
const mapStateToProps = state => {
    return state
}

//是接收方，要实现connect方法的第一个参数
export default connect(mapStateToProps)(Girl)
